package com.zcr.controller;

import com.zcr.pojo.Store;
import com.zcr.service.StoreService;
import com.zcr.vo.Result;
import org.aspectj.weaver.ast.Not;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * @version 1.0
 * @author： 张诚
 * @date： 2021-03-27 12:04
 */
@Controller
@RequestMapping("/quehuo")
public class QuehuoxinxiController {

    @Resource
    private StoreService storeService;

    @GetMapping("/index")
    public String index(){
        return "quehuoxinxi";
    }

    @ResponseBody()
    @GetMapping("/list")
    public Result select(){
        try {
            List<Store> list = storeService.quehuolist(0);
            return Result.sucess(list);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.sucess("查询失败");
        }
    }

}
